package com.brillilab.service.module.message.template.impl.usercenter;

import com.alibaba.fastjson.JSONObject;
import com.brillilab.common.rocketmq.OnsMessageEnum;
import com.brillilab.common.rocketmq.OnsMessageVo;
import com.brillilab.domain.po.message.Message;
import com.brillilab.service.module.message.enums.MessageTargetEnum;
import com.brillilab.service.module.message.template.AbstractMessageTemplate;
import com.brillilab.service.module.message.template.enums.MessageTypeEnum;
import lombok.Data;

/**
 * @author zlb
 * @Title: EntryLabMsgTemplate
 * @ProjectName brill_lab
 * @Description: 非实验室PI直接添加成员成功
 * @date 2019/5/24 17:28
 */
@Data
public class EntryLabMsgTemplate extends AbstractMessageTemplate {
    private String entryUserName;
    private String labName;
    private String operator;


    /**
     *  跳转信息，referId此处为被添加用户的用户Id
     */

    /**
     * 非实验室PI直接添加成员成功
     * @param labId 实验ID
     * @param receiverId 接收人ID
     * @param labMemberId 实验室成员Id
     * @param entryUserName 加入实验室用户
     * @param labName 实验室名称
     * @param operator 操作人
     * @param referId 业务关联ID
     */
    public EntryLabMsgTemplate(Long labId,Long receiverId,Long labMemberId,String entryUserName,String labName,String operator,Long referId) {
        super(labId,receiverId);
        super.setType(MessageTypeEnum.NotLabPIAddMember.getValue());
        super.setTitle("非实验室PI直接添加成员成功");
        String content=String.format(
                        "<span style='color:#F6AC2D'>%s</span>" + "<span>已被</span>" +
                        "<span style='color:#F6AC2D'>%s</span>" + "<span>邀请加入</span>" +
                        "<span style='color:#F6AC2D'>%s</span>"
                ,entryUserName,operator,labName);
        super.setContent(content);
        super.setAppContent(String.format("%s已被%s邀请加入%s",entryUserName,operator,labName));
        this.labMemberId=labMemberId;
        this.entryUserName=entryUserName;
        this.labName=labName;
        this.operator=operator;
        this.referId=referId;
    }

}
